package com.oop;

public class Test5 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name="大白";
        dog.age=10;
        System.out.println("处理前：main中dog.age="+dog.age);
        dog.test22(dog);
        //dog.test33(dog);
        System.out.println("处理后：main中dog.age="+dog.age);
    }
}

class Dog{
    String name;
    int age;
    public void test22(Dog dog){
        dog=null;
    }
    public void test33(Dog dog){
        dog=new Dog();
        dog.name="小黄";
        dog.age=99;
    }
}
